var person = {
    name: "mahu",
    age: 23,
    eyeColor: "blank",
}
console.log(person.name + "已经" + person.age + "岁了")


var person1 = new Object();
person1.name = "theshy";
person1.age = 22;
console.log(person1.name)

var txt = "";
var x;
for (x in person) {
    txt += person[x];
}
console.log(txt)


function person2(firstname, lastname, age, eyecolor) {
    this.firstname = firstname;
    this.lastname = lastname;
    this.age = age;
    this.eyecolor = eyecolor;
    this.changename = function (name) {
        this.lastname = name;
    };
    // this.name = function (plus) {
    //     plus = this.firstname + this.lastname;
    //     return plus;
    // }
}


var people = new person2("an", "xu", 23, "blank");
// people.changename("xiaohu");
console.log(people.lastname)
console.log(people.age)
// console.log(people.name)
var person3 = {
    name: "mahu",
    age: "",
    language: "chinase",
    get lang() {
        return this.language;
    },
    set long(long) {
        this.age = long;
    }
}
console.log(person3.lang)
person3.long = 23;
console.log(person3.age)